<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="language" value="${pageContext.response.locale.language}" />

<div class="header hidden-phone">
	<div class="container">
		<div class="logo">
			<a href="${ctx }"><img src="${ctx}/assets/img/logo.png/"></a>
		</div>
		<div class="menu header-list">
			<ul>
				<li><a href="${ctx }/recommend" id="indexItem0">首页</a></li>
				<li><a href="${ctx }/project/discover" id="indexItem1"></a></li>
				<li><a href="${ctx }/project/open" id="indexItem2"></a></li>
				<li><a href="${ctx }/start" id="indexItem3"></a></li>
			</ul>
		</div>
		<div class="search">
			<form class="navbar-search" method="get" action="${ctx}/project/discover">
				<input type="text" name="qs" placeholder="发现更多...">
				<button type="submit" class="search-btn">
					 <i	class="icon-search"></i>
				</button>
			</form>
		</div>
		<div class="login-menu pull-right" style="float:right;">
		<shiro:guest>
			<a href="${ctx}/login">登录</a> | <a href="${ctx}/regist">注册</a>
		</shiro:guest>
		<shiro:user>
		<div class="dropdown">
			欢迎您,
			<a href="#" id="drop3" class="dropdown-toggle" data-toggle="dropdown" ><span class="caret"></span>
			</a>
			<ul class="dropdown-menu" role="menu" id="single-center" aria-labelledby="drop3" >
				<li><a href="${ctx}/home/message" class=""><i class="icon-envelope"></i>
					<span id="message">消息<br></span></a></li>
				<li><a href="${ctx }/home"><i class="icon-user"></i> <fmt:message
						key="header.menu.home" /></a></li>
				<li><a href="${ctx }/fund"><i class="icon-book"></i> <fmt:message
							key="header.menu.fund" /></a></li>
				<li><a href="${ctx}/home/message#panel-coupon"  name="" class=""><i class="icon-gift"></i>
					<span id="msg-coupon">优惠券<br></span></a></li>
				<li><a href="${ctx }/home/profile"><i class="icon-user"></i>
								<fmt:message key="header.menu.profile" /></a></li>
				<li><a href="${ctx }/logout"><i class="icon-off"></i> <fmt:message
									key="header.menu.signout" /></a></li>
			</ul>
		</div>
		</shiro:user>
		</div>
	</div>
</div>

    <div class="navbar navbar-inverse visible-phone" style="margin-bottom:0px;">
      <div class="navbar-inner" style="border-radius:0px !important;border-bottom:solid 1px #666;">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="${ctx }">YAMI</a>
          <div class="nav-collapse collapse">
            <ul class="nav" style="border-top:solid 1px #2B2828;">
              <li class="">
        <shiro:guest>
			<a href="${ctx}/login">登录/注册</a>
		</shiro:guest>
		<shiro:user>
		  <a href="${ctx }/home"><shiro:principal property="name"/>的个人主页</a>
		</shiro:user>
              </li>
        <shiro:user>
              <li class="active">
                <a href="${ctx }/fund">雅米宝</a>
              </li>
              <li class="">
                <a href="${ctx }/logout">退出登录</a>
              </li>
        </shiro:user>
            </ul>
          </div>
        </div>
      </div>
    </div>

<script type="text/html" id="message-template">
<$	var msgSum = unreadLetterCount + unreadMessageCount + unreadCommentCount + unreadPreferntialCommentCount + unusedCouponCount + unreadPresentCount;
if( msgSum > 0 && msgSum <= 99){$>
	消息(<$=msgSum$>)
<$}else if(msgSum > 100){$>
	消息(99+)
<$}else{$>
	消息
<$}$>
</script>

<c:if test="${env == 'production' }">
<script type="text/javascript">
seajs.use("${ctx}/assets/js-dist/header-page");
</script>
</c:if>
<c:if test="${env != 'production' }">
<script type="text/javascript">
seajs.use("${ctx}/assets/js/header-page");
</script>
</c:if>
